<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Donxon SDK Docs</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Donxon SDK</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Fields">Fields</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Metamethods">Metamethods</a></li>
</ul>


<h2>Classes</h2>
<ul class="nowrap">
  <li><a href="../classes/Debug.html">Debug</a></li>
  <li><a href="../classes/StringBuffer.html">StringBuffer</a></li>
  <li><a href="../classes/Hook.html">Hook</a></li>
  <li><a href="../classes/System.UTF8.html">System.UTF8</a></li>
  <li><a href="../classes/Common.Color.html">Common.Color</a></li>
  <li><a href="../classes/Common.Vector2D.html">Common.Vector2D</a></li>
  <li><strong>Common.Vector</strong></li>
  <li><a href="../classes/Common.NetMessage.html">Common.NetMessage</a></li>
  <li><a href="../classes/Common.TextMenu.html">Common.TextMenu</a></li>
  <li><a href="../classes/Common.ScreenFade.html">Common.ScreenFade</a></li>
  <li><a href="../classes/Common.HUDText.html">Common.HUDText</a></li>
  <li><a href="../classes/Game.NetMessage.html">Game.NetMessage</a></li>
  <li><a href="../classes/Game.TextMenu.html">Game.TextMenu</a></li>
  <li><a href="../classes/Game.ScreenFade.html">Game.ScreenFade</a></li>
  <li><a href="../classes/Game.BarTime.html">Game.BarTime</a></li>
  <li><a href="../classes/UI.Rectangle.html">UI.Rectangle</a></li>
  <li><a href="../classes/UI.ProgressBar.html">UI.ProgressBar</a></li>
  <li><a href="../classes/UI.TextMenu.html">UI.TextMenu</a></li>
  <li><a href="../classes/UI.ScreenFade.html">UI.ScreenFade</a></li>
  <li><a href="../classes/UI.BarTime.html">UI.BarTime</a></li>
</ul>
<h2>Globals</h2>
<ul class="nowrap">
  <li><a href="../globals/Properties.html">Properties</a></li>
  <li><a href="../globals/Functions.html">Functions</a></li>
  <li><a href="../globals/Classes.html">Classes</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/System.html">System</a></li>
  <li><a href="../modules/Common.html">Common</a></li>
  <li><a href="../modules/Game.html">Game</a></li>
  <li><a href="../modules/UI.html">UI</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
  <li><a href="../topics/changelog.md.html">changelog</a></li>
  <li><a href="../topics/credit.md.html">credit</a></li>
  <li><a href="../topics/license.html">license</a></li>
</ul>
<h2>Examples</h2>
<ul class="nowrap">
  <li><a href="../examples/bartime.game.lua.html">bartime.game.lua</a></li>
  <li><a href="../examples/bartime.ui.lua.html">bartime.ui.lua</a></li>
  <li><a href="../examples/deltatiming.game.lua.html">deltatiming.game.lua</a></li>
  <li><a href="../examples/deltatiming.ui.lua.html">deltatiming.ui.lua</a></li>
  <li><a href="../examples/hook.game.lua.html">hook.game.lua</a></li>
  <li><a href="../examples/netmsg.simple.common.lua.html">netmsg.simple.common.lua</a></li>
  <li><a href="../examples/netmsg.simple.game.lua.html">netmsg.simple.game.lua</a></li>
  <li><a href="../examples/netmsg.simple.ui.lua.html">netmsg.simple.ui.lua</a></li>
  <li><a href="../examples/progressbar.ui.lua.html">progressbar.ui.lua</a></li>
  <li><a href="../examples/rectangle.ui.lua.html">rectangle.ui.lua</a></li>
  <li><a href="../examples/screenfade.game.lua.html">screenfade.game.lua</a></li>
  <li><a href="../examples/screenfade.ui.lua.html">screenfade.ui.lua</a></li>
  <li><a href="../examples/stringbuffer.lua.html">stringbuffer.lua</a></li>
  <li><a href="../examples/textmenu.simple.game.lua.html">textmenu.simple.game.lua</a></li>
  <li><a href="../examples/utf8.lua.html">utf8.lua</a></li>
  <li><a href="../examples/vector.2d.lua.html">vector.2d.lua</a></li>
  <li><a href="../examples/vector.3d.lua.html">vector.3d.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>Common.Vector</code></h1>
<p>3D Vector class.</p>
<p>

</p>


<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Common.Vector.x">Common.Vector.x</a></td>
	<td class="summary">Vector x variable.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector.y">Common.Vector.y</a></td>
	<td class="summary">Vector y variable.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector.z">Common.Vector.z</a></td>
	<td class="summary">Vector z variable.</td>
	</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Create">Common.Vector:Create (X[, Y[, Z]])</a></td>
	<td class="summary">Constructs a 3D vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:FromString">Common.Vector:FromString (stringVector)</a></td>
	<td class="summary">Constructs a 3D vector from a string.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Clone">Common.Vector:Clone ()</a></td>
	<td class="summary">Returns a clone of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Length">Common.Vector:Length ()</a></td>
	<td class="summary">Gets the length of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Normalize">Common.Vector:Normalize ()</a></td>
	<td class="summary">Returns the normalized form of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Make2D">Common.Vector:Make2D ()</a></td>
	<td class="summary">Returns the 2D form of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:Length2D">Common.Vector:Length2D ()</a></td>
	<td class="summary">Gets the length of this vector in 2D.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:ToString">Common.Vector:ToString ()</a></td>
	<td class="summary">Returns a string representation of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:DotProduct">Common.Vector:DotProduct (v)</a></td>
	<td class="summary">Returns a dot product from 2 vectors.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:CrossProduct">Common.Vector:CrossProduct (v)</a></td>
	<td class="summary">Returns a cross product from 2 vectors.</td>
	</tr>
</table>
<h2><a href="#Metamethods">Metamethods</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Common.Vector.__index">Common.Vector.__index</a></td>
	<td class="summary">Base class.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector.__tostring">Common.Vector.__tostring</a></td>
	<td class="summary">Returns a string representation of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__unm">Common.Vector:__unm ()</a></td>
	<td class="summary">Returns a negated form of this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__eq">Common.Vector:__eq (v)</a></td>
	<td class="summary">Compares this vector.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__add">Common.Vector:__add (v)</a></td>
	<td class="summary">Returns a vector from addition of 2 vectors.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__sub">Common.Vector:__sub (v)</a></td>
	<td class="summary">Returns a vector from subtraction of 2 vectors.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__mul">Common.Vector:__mul (fl)</a></td>
	<td class="summary">Multiplies this vector with a number value.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Common.Vector:__div">Common.Vector:__div (fl)</a></td>
	<td class="summary">Divides this vector with a number value.</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Fields"></a>Fields</h2>

    <dl class="function">
    <dt>
    <a name = "Common.Vector.x"></a>
    <strong>Common.Vector.x</strong>
    </dt>
    <dd>
    Vector x variable.


    <ul>
        <li><span class="parameter">x</span>
            <span class="types"><span class="type">number</span></span>



         (<em>default</em> 0)
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Common.Vector.y"></a>
    <strong>Common.Vector.y</strong>
    </dt>
    <dd>
    Vector y variable.


    <ul>
        <li><span class="parameter">y</span>
            <span class="types"><span class="type">number</span></span>



         (<em>default</em> 0)
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Common.Vector.z"></a>
    <strong>Common.Vector.z</strong>
    </dt>
    <dd>
    Vector z variable.


    <ul>
        <li><span class="parameter">z</span>
            <span class="types"><span class="type">number</span></span>



         (<em>default</em> 0)
        </li>
    </ul>





</dd>
</dl>
    <h2 class="section-header "><a name="Methods"></a>Methods</h2>

    <dl class="function">
    <dt>
    <a name = "Common.Vector:Create"></a>
    <strong>Common.Vector:Create (X[, Y[, Z]])</strong>
    </dt>
    <dd>
    Constructs a 3D vector.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">X</span>
            <span class="types"><span class="type">number</span> or <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
         The value of X. | The vector-compatible table.
        </li>
        <li><span class="parameter">Y</span>
            <span class="types"><span class="type">number</span></span>
         The value of Y (Ignored if <code>X</code> is table).
         (<em>optional</em>)
        </li>
        <li><span class="parameter">Z</span>
            <span class="types"><span class="type">number</span></span>
         The value of Z (Ignored if <code>X</code> is table).
         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="comment">-- You can do this.
</span>vec = Common.Vector:Create( <span class="number">1</span> , <span class="number">2</span> , <span class="number">3</span> )
<span class="comment">-- or do this.
</span>vec = Common.Vector:Create( { x = <span class="number">1</span> , y = <span class="number">2</span> , z = <span class="number">3</span> } )
<span class="comment">-- or do this.
</span>vec = Common.Vector:Create( <span class="string">"1 2 3"</span> )</pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:FromString"></a>
    <strong>Common.Vector:FromString (stringVector)</strong>
    </dt>
    <dd>
    Constructs a 3D vector from a string.
 Format should be:  x y z


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">stringVector</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         The string vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:Clone"></a>
    <strong>Common.Vector:Clone ()</strong>
    </dt>
    <dd>
    Returns a clone of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:Length"></a>
    <strong>Common.Vector:Length ()</strong>
    </dt>
    <dd>
    Gets the length of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">number</span></span>
        The length.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:Normalize"></a>
    <strong>Common.Vector:Normalize ()</strong>
    </dt>
    <dd>
    Returns the normalized form of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The normalized vector.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:Make2D"></a>
    <strong>Common.Vector:Make2D ()</strong>
    </dt>
    <dd>
    Returns the 2D form of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector2D.html#">Common.Vector2D</a></span>
        The new 2D vector.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:Length2D"></a>
    <strong>Common.Vector:Length2D ()</strong>
    </dt>
    <dd>
    Gets the length of this vector in 2D.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">number</span></span>
        The length.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:ToString"></a>
    <strong>Common.Vector:ToString ()</strong>
    </dt>
    <dd>
    Returns a string representation of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        The string of integers.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:DotProduct"></a>
    <strong>Common.Vector:DotProduct (v)</strong>
    </dt>
    <dd>
    Returns a dot product from 2 vectors.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">v</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
         The other vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The dot product.
    </ol>




</dd>
    <dt>
    <a name = "Common.Vector:CrossProduct"></a>
    <strong>Common.Vector:CrossProduct (v)</strong>
    </dt>
    <dd>
    Returns a cross product from 2 vectors.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">v</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
         The other vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">number</span></span>
        The cross product.
    </ol>




</dd>
</dl>
    <h2 class="section-header "><a name="Metamethods"></a>Metamethods</h2>

    <dl class="function">
    <dt>
    <a name = "Common.Vector.__index"></a>
    <strong>Common.Vector.__index</strong>
    </dt>
    <dd>
    Base class.


    <ul>
        <li><span class="parameter">__index</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Common.Vector.__tostring"></a>
    <strong>Common.Vector.__tostring</strong>
    </dt>
    <dd>
    Returns a string representation of this vector.


    <ul>
        <li><span class="parameter">__tostring</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#Common.Vector:ToString">Common.Vector.ToString</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Common.Vector:__unm"></a>
    <strong>Common.Vector:__unm ()</strong>
    </dt>
    <dd>
    Returns a negated form of this vector.



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create( <span class="number">1</span> , <span class="number">2</span> , <span class="number">3</span> );
vec = -vec;
<span class="global">print</span>( vec:ToString() ); <span class="comment">-- prints "-1 -2 -3".</span></pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:__eq"></a>
    <strong>Common.Vector:__eq (v)</strong>
    </dt>
    <dd>
    Compares this vector.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">v</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
         The other vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">bool</span></span>
        Returns true if equals.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create();
<span class="global">print</span>( vec == Common.vecZero ); <span class="comment">-- prints "true".</span></pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:__add"></a>
    <strong>Common.Vector:__add (v)</strong>
    </dt>
    <dd>
    Returns a vector from addition of 2 vectors.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">v</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
         The other vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create( <span class="number">2</span> , <span class="number">3</span> , <span class="number">4</span> );
vec = vec + {x = <span class="number">2</span> , y = <span class="number">1</span> , z = <span class="number">0</span>};
<span class="global">print</span>( vec:ToString() ); <span class="comment">-- prints "4 4 4".</span></pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:__sub"></a>
    <strong>Common.Vector:__sub (v)</strong>
    </dt>
    <dd>
    Returns a vector from subtraction of 2 vectors.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">v</span>
            <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
         The other vector.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create( <span class="number">2</span> , <span class="number">3</span> , <span class="number">4</span> );
vec = vec - {x = <span class="number">2</span> , y = <span class="number">1</span> , z = <span class="number">3</span>};
<span class="global">print</span>( vec:ToString() ); <span class="comment">-- prints "0 2 1".</span></pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:__mul"></a>
    <strong>Common.Vector:__mul (fl)</strong>
    </dt>
    <dd>
    Multiplies this vector with a number value.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">fl</span>
            <span class="types"><span class="type">number</span></span>
         The modifier.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create( <span class="number">2</span> , <span class="number">3</span> , <span class="number">4</span> );
vec = vec * <span class="number">2</span>;
<span class="global">print</span>( vec:ToString() ); <span class="comment">-- prints "4 6 8".</span></pre>
    </ul>

</dd>
    <dt>
    <a name = "Common.Vector:__div"></a>
    <strong>Common.Vector:__div (fl)</strong>
    </dt>
    <dd>
    Divides this vector with a number value.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">fl</span>
            <span class="types"><span class="type">number</span></span>
         The modifier.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="../classes/Common.Vector.html#">Common.Vector</a></span>
        The new vector.
    </ol>



    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="keyword">local</span> vec = Common.Vector:Create( <span class="number">4</span> , <span class="number">6</span> , <span class="number">8</span> );
vec = vec / <span class="number">2</span>;
<span class="global">print</span>( vec:ToString() ); <span class="comment">-- prints "2 3 4".</span></pre>
    </ul>

</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-15 21:15:36 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
